<?
	class Base
	{
		var $logfile;
		
		function Base()
		{
			// :TODO: Add constructor logic here
		}
		
		function OpenLogFile($path = "./log.txt")
		{
			if (!$this->logfile)
			{
				$this->logfile = fopen($path, "a+");
			}
		}
		
		function Log($str)
		{
			$this->OpenLogFile();
			if (is_array($str))
			{
				foreach($str as $sk=>$sv)
					fwrite($this->logfile, date("m/d/y H:i:s"). ": $sk = $sv\r\n");
			}
			else
				fwrite($this->logfile, date("m/d/y H:i:s"). ": $str\r\n");
		}
		
		//
		function CloseLogFile()
		{
			fclose($this->logfile);
		}
	}
?>
